package com.xinchao.ck_mips.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.CalendarView;
import android.widget.Toast;

import com.xinchao.ck_mips.event.NetWorkChangeEvent;
import com.xinchao.ck_mips.utils.NetWorkUtil;

import de.greenrobot.event.EventBus;

/**
 * Created by wq on 2019/5/23.
 * 监听网络变化
 */
public class NetWorkChangeReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (!NetWorkUtil.isNetworkAvailable(context)) {
            Toast.makeText(context, "设备网络异常，请检查网络", Toast.LENGTH_LONG).show();
        }
        //EventBus.getDefault().post(new NetWorkChangeEvent());
    }
}
